﻿namespace Sidvall.UI.Entities
{
    public sealed class MenuItem : BusinessBase
    {
        #region Public Members

        #region Id

        private string _Id;
        public string Id
        {
            get
            {
                return _Id;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_Id == value)
                    return;
                _Id = value;
                OnPropertyChanged(nameof(Id), true, true);
            }
        }

        #endregion
        #region Code

        private string _Code = string.Empty;
        public string Code
        {
            get
            {
                return _Code;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_Code == value)
                    return;
                _Code = value;
                OnPropertyChanged(nameof(Code), true, true);
            }
        }

        #endregion
        #region Name

        private string _Name = string.Empty;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_Name == value)
                    return;
                _Name = value;
                OnPropertyChanged(nameof(Name), true, true);
            }
        }

        #endregion
        #region Description

        private string _Description = string.Empty;
        public string Description
        {
            get
            {
                return _Description;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_Description == value)
                    return;
                _Description = value;
                OnPropertyChanged(nameof(Description), true, true);
            }
        }

        #endregion
        #region Image1

        private string _Image1 = string.Empty;
        public string Image1
        {
            get
            {
                return _Image1;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_Image1 == value)
                    return;
                _Image1 = value;
                OnPropertyChanged(nameof(Image1), true, true);
            }
        }

        #endregion
        #region Image2

        private string _Image2 = string.Empty;
        public string Image2
        {
            get
            {
                return _Image2;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_Image2 == value)
                    return;
                _Image2 = value;
                OnPropertyChanged(nameof(Image2), true, true);
            }
        }

        #endregion
        #region TargetType

        private System.Type _TargetType;
        public System.Type TargetType
        {
            get
            {
                return _TargetType;
            }
            set
            {
                _TargetType = value;
            }
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return this.Name;
        }

        #endregion

        #endregion
        #region Constructors

        public MenuItem()
        {
        }

        #endregion
    }
}
